package com.woniuxy.service.impl;

import com.woniuxy.dao.CategoryDao;
import com.woniuxy.entity.Category;
import com.woniuxy.entity.ResponseEntity;
import com.woniuxy.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName CategoryServiceImpl
 * @Description TODO
 * @Author 冯浩波
 * @Date 2022/3/16 10:04
 */
@Service
public class CategoryServiceImpl implements CategoryService {
    @Autowired(required = false)
    CategoryDao categoryDao;

    @Override
    public ResponseEntity findCategory(Category category) {
        List<Category> categoryList = categoryDao.findCategory(category);
        if (categoryList.size() > 0) {
            return ResponseEntity.success("查询成功",categoryList);
        } else {
            return ResponseEntity.error("查询失败");
        }
    }
}
